<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>添加学生信息</title>
<script type="text/javascript">
	function check(form) {
		if (form.id.value == "") {
			alert("学号不能为空");
			return false;
		}
		if (form.name.value == "") {
			alert("姓名不能为空");
			return false;
		}
		if (form.sex.value == "") {
			alert("性别不能为空");
			return false;
	    if (form.age.value == "") {
			alert("年龄不能为空");
			return false;
		}
		return true;
	}
</script>
<style type="text/css">
ul {
	list-style: none; 
	margin: 0px; 
	padding: 5px; 
}

li {
	padding: 5px; 
}
</style>
</head>
<body>
	<form action="addstudentResult.jsp" method="post" onsubmit=" return check(this)">
		<ul>
			<li>学         号：<input type="text" name="id" /></li>
			<li>姓         名：<input type="text" name="name" /></li>
			<li>性　　别：<input type="text" name="sex" /></li>
			<li>年　　龄：<input type="text" name="age" /></li>
			<li><input type="submit" value="添　加"></li>
		</ul>
	</form>
</body>
</html>